﻿#ifndef PLCCLIENTSTATUSWIDGET_H
#define PLCCLIENTSTATUSWIDGET_H

#include <QGroupBox>
#include <QLabel>
#include <QMap>
#include <QVBoxLayout>

class PLCClientOneStatusWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PLCClientOneStatusWidget(const QString& name = "",QWidget *parent = nullptr);
    void setText(const QString& status);
private:
    QLabel* lblStatus;
};

class PLCClientStatusWidget : public QGroupBox
{
    Q_OBJECT
public:
    explicit PLCClientStatusWidget(const QString& name = "", QWidget *parent = nullptr);
    void addOne(QString name);
    void removeOne(QString name);
    void setStatus(QString name, QString status);
signals:
private:
    QMap<QString, PLCClientOneStatusWidget*> mMapWgtPLCClientStatus;
    QVBoxLayout* mLayout;
};

#endif // PLCCLIENTSTATUSWIDGET_H
